<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script src="<%=request.getContextPath()%>/ui/js/jquery.js"></script>
<script src="<%=request.getContextPath()%>/ui/js/jquery.dataTables.min.js"></script>
<script src="<%=request.getContextPath()%>/ui/js/customDataTables.js"></script>

<script language="javascript">
	function viewThesisDetails(thesisId) {
		$('#thesisId').val(thesisId);
		$('#facultyDetailsForm').attr('action', 'viewThesisDetails.html');
		$('#facultyDetailsForm').submit();
	}
	
</script>

<%@include file="/ui/jsp/includes/noNavHeader.jspf"%>
<div class="container-fluid">

    <form:form id="facultyDetailsForm" class="form-horizontal">
		
        <div id="top" class="hero-unit">

            <div id="thesis-details-header"> Faculty Details
            </div>
            <hr>

            <div class="control-group">

                <label class="control-label">Full Name:</label>
                <div class="controls"> ${faculty.getFullName()}</div>
                <label class="control-label">N Number:</label>
                <div class="controls"> ${faculty.nnumber}</div>
                <c:if test="${empty faculty.nnumber}">
                <br/>
                </c:if>
                <label class="control-label">Email:</label>
                <div class="controls"> ${faculty.email}</div>
                <c:if test="${empty faculty.email}">
                <br/>
                </c:if>
                <label class="control-label">Web Page URL:</label>
                <div class="controls"> <a href="${faculty.webpageUrl}">${faculty.webpageUrl}</a></div>

            </div>
        </div>
        <div id="top" class="hero-unit">
        	<div id="thesis-details-header"> Committee Details</div>
        	<hr>
        	<div>
        		<table id='dataTableList' class="table table-striped table-bordered">
                    <thead>
                        <tr>
                            <th width="8%">Action</th>
                            <th>Thesis Title</th>
                            <th width="15%">Milestone</th>
                            <th width="10%">Student</th>
                            <th>Committee Role</th>
                            <th style="display:none;">Category</th>
                       </tr>
                   </thead>
                   <tbody>
                   		<c:forEach var="thesis" items="${committeeList}">	
                   			
                   			<tr>
                                <td>
                                	<a href="javascript:viewThesisDetails('${thesis.thesisId}')"><img src="<%=request.getContextPath()%>/ui/images/view.gif" title="View"/></a>
                                </td>
                                <td>${thesis.title}</td>
                                <td>${thesis.thesisStatusOverviewString}</td>
                                <td>${thesis.student.firstName}&nbsp;${thesis.student.lastName}</td>
                                <td>
                                	<c:choose>
	                                	<c:when test="${thesis.getThesisChairIdasInt() == faculty.facultyId}">
	                                	Thesis Advisor
	                                	</c:when>
	                                	<c:otherwise>
	                                	Committee Member
	                                	</c:otherwise>
                                	</c:choose>
                                </td>
                                <td style="display:none;">${thesis.category.categoryName}</td>
                            </tr>
                   		</c:forEach>
                   </tbody>
        		</table>
        		
        	</div>
        </div>
        <input type="hidden" id="thesisId" name="thesisId" value=""/>
    </form:form>

</div>
<%@include file="/ui/jsp/includes/footer.jspf"%>

<style>
    .form-horizontal {
        border: 0 none;
        margin-left: 0px;
        margin-top: 0px;
        padding-top: 0px;
        width: 100%;
    }

    .form-horizontal .control-label {
        float: left;
        font-weight: bold;
        padding-top: 5px;
        text-align: right;
        width: 160px;
    }

    label, select, button, input[type="button"], input[type="reset"], input[type="submit"], input[type="radio"], input[type="checkbox"] {
        cursor: pointer;
    }
</style>